"""
@File    :   out.py
@Time    :   2024/03/25 12:31:47
@Author  :   Qrj
@Email   :   923207736@qq.com
@description   :   租户套餐相关的pydantic序列化模型
"""

from datetime import datetime

from pydantic import BaseModel, Field, TypeAdapter

from src.schemas.out import BaseOutSchemaConfigMixin


class TenantPackageAndMenuCompleteOutSchema(BaseModel, BaseOutSchemaConfigMixin):
    """完整的且附带菜单ID列表和菜单权限标识列表的租户套餐序列化模型"""

    id: int = Field(default=..., description="主键")
    name: str = Field(default=..., description="套餐名称")
    status: bool = Field(default=..., description="状态")
    remark: str = Field(default=..., description="备注")
    create_datetime: datetime = Field(default=..., description="创建时间")
    update_datetime: datetime = Field(default=..., description="修改时间")
    creator_username: str = Field(default=..., description="创建者")
    updater_username: str = Field(default=..., description="修改者")
    menu_ids: list[int] = Field(default=..., description="菜单ID列表")
    menu_permission: list[str] = Field(default=..., description="菜单权限标识列表")


class TenantPackageCompleteOutSchema(BaseModel, BaseOutSchemaConfigMixin):
    """完整的租户套餐序列化模型"""

    id: int = Field(default=..., description="主键")
    name: str = Field(default=..., description="套餐名称")
    status: bool = Field(default=..., description="状态")
    remark: str = Field(default=..., description="备注")
    create_datetime: datetime = Field(default=..., description="创建时间")
    update_datetime: datetime = Field(default=..., description="修改时间")
    creator_username: str = Field(default=..., description="创建者")
    updater_username: str = Field(default=..., description="修改者")


# 完整的租户套餐序列化列表模型
ListTenantPackageCompleteOutSchema = TypeAdapter(list[TenantPackageCompleteOutSchema])


class TenantPackageSimpleOutSchema(BaseModel, BaseOutSchemaConfigMixin):
    """简单的租户套餐序列化模型"""

    id: int = Field(default=..., description="主键")
    name: str = Field(default=..., description="套餐名称")


# 简单的租户套餐序列化列表模型
ListTenantPackageSimpleOutSchema = TypeAdapter(list[TenantPackageSimpleOutSchema])
